package com.example.demo.controller;

import com.example.common.res.CommonResponse;
import com.example.demo.service.DemoService;
import com.example.pojo.Demo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("out")
public class DemoController {
    @Autowired
    private DemoService demoService;
    @PostMapping("demo")
    public CommonResponse<Demo> demo(@RequestBody Demo demo){
        return CommonResponse.success(this.demoService.demo(demo));
    }
}
